package com.bxd.baodan.mvp.base;

import java.lang.ref.WeakReference;

/**
 * Created by Administrator on 2017/3/3 0003.
 * V  对应着Activity 的UI抽象接口  视图
 */

public abstract class BasePresenter<V extends IView> {
    protected V v;

    /**
     * 持有UI接口的弱引用
     */
    protected WeakReference<V> mViewRef;

    /**
     * 获取数据方法
     */
  //  public abstract void start();

    public void attachView(V view) {
        mViewRef = new WeakReference<V>(view);
    }

    /**
     * 解绑
     */
    public void detachView()
    {
        if(mViewRef!=null)
        {
            mViewRef.clear();
            mViewRef=null;
        }
    }
}
